package fr.mma.livraison.dao;

import com.googlecode.objectify.ObjectifyService;

import fr.mma.livraison.model.persistence.Application;
import fr.mma.socle.dao.CommonDao;

public class ApplicationDao extends CommonDao<Application> {

	public ApplicationDao() {
		super(Application.class);
	}

	static {
		ObjectifyService.register(Application.class);
	}

	public Application getOrCreate(final String identifiant) {
		Application found = ofy().find(Application.class, identifiant);
		if (found == null) {
			found = new Application(identifiant);
		}
		return found;
	}

	public Application get(final String identifiant) {
		return ofy().find(Application.class, identifiant);
	}

}
